//线程分离
#include<iostream>
#include<string>
#include<ctime>
#include<unistd.h>
#include<pthread.h>
#include<stdio.h>
using namespace std;


__thread int c=10;  //线程独立资源

void* run1(void * argv)
{

    string name=static_cast<char*>(argv);
    int cnt=5;
    while(cnt--)
    {
        cout<<"thread run:"<<name<<":"<<cnt<<endl;
    }



}


int main()
{
    pthread_t tid;

    pthread_create(&tid,nullptr,run1,(void *)"thread 1");


    pthread_detach(tid);

    sleep(10);




    return 0;
}

